// app/service/user.js
const Service = require('egg').Service;

class BillService extends Service {
  async getList(billnum){
    let result;
    if(billnum){
      result = await this.app.mysql.query('bill',{
        where:{billnum:billnum},
      });
    }else{
      result = await this.app.mysql.select('bill');
    }
    return result;
  }
  async addBill(billNum,timp,optname){
    const result = await this.app.mysql.insert('bill',{
      billnum:billNum,
      timp:timp,
      optname:optname,
      optid:"",
    })
    return result;
  }
}
module.exports = BillService;